$(document).ready(function(){
	var app_path = app_path ? app_path : '/';
	$.getJSON(app_path+'p_groups.html?callback=?',{},function(json){ 
		var xbang = '';
		var qlbang = '';
		var ftbang = '';
		for(var i=0;i<3;i++) {
			xbang +='<div class="i_list clearfix">'+
						'<div class="i_left">'+
							'<a target="_blank" href="http://star.ifensi.com/s'+json['xbang'][i]['id']+'/">'+
								'<div class="i_pic">'+
									'<div class="ibg"></div>'+
									'<img src="'+json['xbang'][i]['thumb']+'" alt="'+json['xbang'][i]['title']+'" width="220" height="220" />'+
									'<span class="pic_title">'+json['xbang'][i]['title']+'</span>'+
								'</div>'+
							'</a>'+
						'</div>'+
						'<div class="i_right">'+
							'<a target="_blank" href="http://star.ifensi.com/s'+json['xbang'][i]['id']+'/dongtai/">最新动态</a>'+
							'<a target="_blank" href="http://star.ifensi.com/s'+json['xbang'][i]['id']+'/xiezhen/">最美写真</a>'+
							'<span class="num'+(i+1)+'"></span>'+
							'<a target="_blank" href="http://star.ifensi.com/s'+json['xbang'][i]['id']+'/ziliao/">个人档案</a>'+
							'<a class="jia" href="javascript:;">加入粉团</a>'+
							'<span class="ma"></span>'+
						'</div>'+
					'</div>';
			qlbang +='<div class="i_list clearfix">'+
						'<div class="i_left">'+
							'<a target="_blank" href="http://star.ifensi.com/s'+json['qbang'][i]['id']+'/">'+
								'<div class="i_pic">'+
									'<div class="ibg"></div>'+
									'<img src="'+json['qbang'][i]['thumb']+'" alt="'+json['qbang'][i]['title']+'" width="220" height="220" />'+
									'<span class="pic_title">'+json['qbang'][i]['title']+'</span>'+
								'</div>'+
							'</a>'+
						'</div>'+
						'<div class="i_right">'+
							'<a target="_blank" href="http://star.ifensi.com/s'+json['qbang'][i]['id']+'/dongtai/">最新动态</a>'+
							'<a target="_blank" href="http://star.ifensi.com/s'+json['qbang'][i]['id']+'/xiezhen/">最美写真</a>'+
							'<span class="num'+(i+1)+'"></span>'+
							'<a target="_blank" href="http://star.ifensi.com/s'+json['qbang'][i]['id']+'/ziliao/">个人档案</a>'+
							'<a class="jia" href="javascript:;">加入粉团</a>'+
							'<span class="ma"></span>'+
						'</div>'+
					'</div>';
			ftbang +='<div class="i_list clearfix">'+
						'<div class="i_left">'+
							'<a target="_blank" href="http://star.ifensi.com/s'+json['fant'][i]['fan_id']+'/">'+
								'<div class="i_pic">'+
									'<div class="ibg"></div>'+
									'<img src="'+json['fant'][i]['thumb']+'" alt="'+json['fant'][i]['title']+'" width="220" height="220" />'+
									'<span class="pic_title">'+json['fant'][i]['title']+'</span>'+
								'</div>'+
							'</a>'+
						'</div>'+
						'<div class="i_right">'+
							'<a target="_blank" href="http://star.ifensi.com/s'+json['fant'][i]['fan_id']+'/dongtai/">最新动态</a>'+
							'<a target="_blank" href="http://star.ifensi.com/s'+json['fant'][i]['fan_id']+'/xiezhen/">最美写真</a>'+
							'<span class="num'+(i+1)+'"></span>'+
							'<a target="_blank" href="http://star.ifensi.com/s'+json['fant'][i]['id']+'/ziliao/">个人档案</a>'+
							'<a class="jia" href="javascript:;">加入粉团</a>'+
							'<span class="ma"></span>'+
						'</div>'+
					'</div>';		
		}

		$("#xbang").html(xbang);
		$("#ftbang").html(ftbang);
		$("#qlbang").html(qlbang);
		
		$(".jia").click(function(){
		$(this).siblings(".ma").toggle();	
		})
		
		$(".jia").hover(function(){
			$(this).siblings(".ma").hide();	
		},function(){
			$(this).siblings(".ma").hide();	
		})
		
	 });
})
